<template>
	<!-- //引入轮播图样式 -->
	<div class="swiper">
		
		<!-- //轮播图效果，三秒自动切换 -->
		<el-carousel :interval="3000" type="card" height="280px" >
			<el-carousel-item v-for="(item,index) in swiperList" :key="index">
				
				<img :src="item.imageUrl"/>
			</el-carousel-item>
			
		</el-carousel>
		
	</div>
	
	
	
</template>

<script>

	export default {
		name:"swiper",
		data(){
			return{
				swiperList:[]
			}
		},
		mounted() {
			/* 将所有幻灯片查询出来 */
			  this.$axios.get('/BannerServlet?method=queryData')
			    .then((res) => {
			      console.log(res);
			      this.swiperList = res.data.data;
			      this.swiperList.forEach((e) => {
			        e.updateTime = format(e.updateTime)
			      })
			    })
			    .catch((err) => {
			
			    })
			
		}
	}
</script>

<style  lang="scss" scoped>
 @import '../../assets/css/swiper.scss';
</style>



